'use strict';

var fs = require('fs');
var path = require('path');
var controllers = {};
fs.readdirSync(__dirname)
    .filter(function (file) {
        return (file.indexOf('.') !== 0) && (file !== 'index.js') && (file.slice(-3) === '.js');
    })
    .forEach(function (file) {
        var name = file.substring(0, file.length - 3);
        controllers[name] = require(path.join(__dirname, name));
    });

module.exports = controllers;
